﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace VisaValeCheck
{
    internal class ConversorDepositos : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is Compra)
            {
                return string.Format("R$ {0:0.00} em {1:dd/MM/yyyy}", ((Compra)value).Valor, ((Compra)value).Data);
            }
            else if (value is DateTime)
            {
                return ((DateTime)value).ToString("dd/MM/yyyy");
            }
            else
            {
                return string.Empty;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    internal class ConversorCompra : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is Compra)
            {
                return string.Format("{0:dd/MM/yyyy} R${1:0.00} - {2}", ((Compra)value).Data, ((Compra)value).Valor, ((Compra)value).Local);
            }
            else
            {
                return string.Empty;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
